<?php
namespace lightblog\home\model;

use lightblog\engine\model;
use lightblog\home\model\articleModel;

class timelineModel extends ArticleModel {

    /**
     * 获取时间线
     *
     * @param string $start 开始时间
     * @param string $end 结束时间
     */
    function getTimeline($start = "", $end = "") {
        $ret = array();

        $list = $this->getArticleList(false);

        foreach ($list as $article) {
            $timestamp = strtotime($article['modified']);
            $ym = date('Y_m', $timestamp);

            $ret[$ym][] = $article;
        }

        return $ret;
    }
}
